=============================
 Glow in the Dahrk
=============================
by Melchior Dahrk & NullCascade
Version 2.9.1

This is a modern, pluginless replacement of the old Windows Glow mods. Windows Glow (WG) suffered from every mod needing a patch to work with it. Glow in the Dahrk (GITD) handles this automatically through the meshes themselves with a powerful Lua code by NullCascade which can switch the visible portion of NIFs on the fly. With this feature, any mod using the vanilla window NIFs will automatically switch to a glowing version at night. In addition, WG forced players to use the textures it provided which didn't always match their texture replacer of choice. Glow in the Dahrk accomplishes a subtle glow on the windows without needing to replace the vanilla textures; so players can use vanilla or a texture replacer of their choice!

It is a very simple process for modders to make non-vanilla meshes compatible with this script as well. This script can make any static model in the game switch to a nighttime version - not just windows.

Features:
* Vanilla windows transition to glowing versions at night
* Automatic compatibility with any mods using the meshes included with this mod (no patches required!)
* Hlaalu, Telvanni, Redoran, Velothi, Mournhold, Skaal, Imperial Fort, and Imperial Common sets all now have a nighttime glow for windows.
* Supports vanilla textures and texture replacers for windows (choose your own look!)
* A more natural, muted glow at night rather than the bright, garish design of the old Windows Glow
* Smooth pulsing light effect for all windows
* Transition to nighttime/daytime models is staggered for a more natural experience
* In-Game Mod Configuration Menu to tweak certain mod settings like the dusk/dawn hours and transition staggering
* Includes weather-dependent daylight glow on interior windows (e.g. won't be bright during storms - pairs well with True Lights and Darkness which has weather-dependent light sources)
* Optional sunrays for interior glow!
* Optional plugin to add Telvanni dormers to Vvardenfell
* Support for any static objects to be made to transition to nighttime versions
* Pluginless and patch-free alternative to "Windows Glow"
* Patch for Tamriel Rebuilt windows
* Includes miscellaneous patch for various mod-added windows


=============================
 Installation
=============================

Required
Files
==============
MGE XE 0.10.1 or later: https://www.nexusmods.com/morrowind/mods/41102
MWSE 2.1 nightly (install 2nd): http://nullcascade.com/mwse/mwse-dev.zip


Wrye Mash
Installation
==============
Archive is set up to use Sub-Packages for Mash Installers:

	00 Core - Note that the MWSE folder may need to be copied into your Data Files folder manually

	Optional

		01 Hi Res Window Texture Replacer

		02 Interior Sunrays

		03 Glass Nord Windows - for those who prefer the original Windows Glow look
		03 Glass Nord Windows Interior Sunrays - pick either this or the no-rays version

		04 Telvanni Dormers - adds windows to all Vvardenfell Telvanni settlements (there are none in the vanilla game)

		05 Raven Rock Glass Windows - for those who prefer the Windoors glow glass windows for Raven Rock
		05 Raven Rock Glass Windows Interior Sunrays - pick either this or the no-rays version	

	Patches

		06 Tamriel Rebuilt Patch - Install with or without sunrays, not both
		06 Tamriel Rebuilt Patch Interior Sunrays - Install with or without sunrays, not both

		07 Miscellaneous Mods Patch - patch to cover various mods and resources which add custom windows
		07 Miscellaneous Mods Patch Interior Sunrays - Install with or without sunrays, not both
			Known Mods which this patch covers:
				Castle Kanthrock
				Castle Hestatur
				If you know any others which use these meshes, let me know!

		08 Dark Molag Mar Patch - Install with or without sunrays, not both
		08 Dark Molag Mar Patch Interior Sunrays - Install with or without sunrays, not both

		09 Windoors Patch - use this ESP instead of the one included with Windoors	



Unless you want Telvanni Dormers, the Raven Rock glass windows, or the Windoors Glow patch, there are no plugins to activate, you're ready to play!


Manual
Installation
==============
To install copy all files into the Data Files directory. No plugin to activate, you're ready to play!


=============================
 Compatibility
=============================
Window Glass Retextures:
Due to the way GITD handles the glow texture overlay, some colors of window retextures may result in a weird glow color. The best known case of this issue is if the tx_window_diamond_01.dds texture is too blue, the glow at night will appear greenish. The best way to circumvent this is to use the provided "Hi Res Window Texture Replacer" or experiment with what looks good in your game.

Distant Lights:
This mod must be installed AFTER Distant Lights. If you still want the Hlaalu, Redoran, and Velothi windows from DL to show up in Distant Land, then add "_dist" to the end of their file names.


=============================
 Credits
=============================
Greatness7 for the code used to accelerate the mesh creation and for uncovering the NiCollisionSwitch node
Siberian Crab for the basic glow texture from which I designed the others
Hrnchamd for quickly releasing a fix to MGE XE to let this mod work properly
Merlord for helping with the weather-based interior glow script
NullCascade again for not only making the code used by this mod, but also for continuing to develop MWSE into the Lua-based powerhouse it has become
Morrowind Modding Discord for extensive playtesting and feedback as this mod was developed
Wolli & Atrayonis for help on the optional Raven Rock glass windows patch


=============================
 Permissions
=============================
The assets in this mod archive may be used freely in other TES3 mods as long as credit is given where it is due. You may not rehost this mod unless I have been unable to be reached for 3 months.


=============================
 Changelog
=============================
V1.0.0 - Initial Release
V1.0.1 - Fixed texture filtering on MH meshes, fixed crash in interiors during the day with the Nord windows, replaced Lua code with non-debug version, added mip maps for hi-res textures
V1.0.2 - Fixed texture filter on Skaal meshes, fixed MGE XE distant land generation errors, fixed interior glow for in_c_plain_r_cwin_tri_01, and fixed material settings on mournhold temple
V1.0.3 - Fixed the MGE XE errors for real this time
V1.0.4 - Fixed texture path issues on Mournhold interior window meshes
V1.0.5 - Updated MWSE lua file name and location to be compatible with the latest nightly
V1.1.0 - Added patch for TR meshes. Fixed "in_c_rich_r_swin_bay_01.nif" position. Fixed "ex_vivec_c_02.nif" not animating. Made the Mournhold and Imperial arrow slits dimmer.
V2.0.0 - Adds optional interior sunrays. Interior window glow is now weather dependent! Adds Windoors patch (removes Windoors edits to windows - keeps shacks, ashlander tents, and door glows). Adds optional glass Nord windows (like the original Windows Glow). Adds optional plugin to add Telvanni dormers to Vvardenfell. Improves Telvanni dormer appearance.
V2.0.1 - Fix for the Windoors patch. Pointed the optional glass nord windows to "tx_window_diamond_01".
V2.0.2 - Reordered archive for easier Mash installation
V2.0.3 - UV/texture fix for optional glass nord windows with interior sunrays
V2.1.0 - Added optional ESP to add Telvanni windows to interiors of housepods (matching the exterior windows). Fixed Windoors patch.
V2.2.0 - Cleaned up and fixed some minor bugs in the code. Added Mod Configuration Menu!
V2.2.1 - Fixed collision on several common bay windows where you could get stuck on the sunray
V2.3.0 - Added optional interior sunrays for the Tamriel Rebuilt patch. Added miscellaneous mods patch. Made ex_velothi_window_01.nif have sunrays.
V2.4.0 - Added patch for Dark Molag Mar
V2.4.1 - Fixed in_c_plain_r_cwin_tri_01.nif which was glowing at night indoors
V2.4.2 - Made the "Stagger Exterior Transitions" Mod Config option save when you reload the game
V2.4.3 - Made several interior window meshes work in exteriors if used there by mods
V2.4.4 - Fixed Indoril interior window in exteriors
V2.4.5 - Added missing ex_gg_03.nif mesh
V2.5.0 - Changed to BAIN archive structure. Removed sunrays from in_c_plain_room_cwin_01 and in_c_plain_room_cwin_02 for the base version. Added in_nord_house_04.nif which was missed before. Fixed non-animated night windows for ex_nord_house_04.nif.
V2.5.1 - Added interior support to ex_common_window_03.nif. Added tr_ex_velothi_temple03 to TR patch. Fixed collision on TR patch windows.
V2.6.0 - Added optional glass Raven Rock windows
V2.6.1 - Hotfix for Raven Rock windows (exterior meshes were bright and some of the Raven Rock interiors were missed in the plugin)
V2.6.2 - Added interior effect to Imperial arrow slits
V2.6.3 - Fixed exterior glow for Imperial arrow slits
V2.7.0 - Revised code so that activators (e.g. Raven Rock buildings and Strongholds) will switch windows at night as well. Fixed bad UV on in_mh_window_01.nif. Fixed collision on interior Raven Rock meshes. Fixed some placement issues in the Raven Rock ESP.
V2.7.1 - Added sunrays to the Redoran windows for the optional Interior Sunrays patch
V2.8.0 - Fixed texture issue on sunrays. Updated the meshes with sunrays to use NiCollisionSwitch so that players can pick up items and activate objects through them. At the time of writing, NiCollisionSwitch is incompatible with OpenMW so it is recommended that you stick with version 2.7.1 for now if you use it.
V2.8.1 - Patch for MGE XE Distant Land which does not currently recognize NiCollisionSwitch. No change to functionality in 2.8.0.
V2.8.2 - Cleaned "GITD_WL_RR_Interiors.esp" for the optional Raven Rock Glass Windows addon.
V2.8.3 - Changes "ex_vivec_h_16.nif" to fix an MWSE error.
V2.9.0 - Overhaul of the RR module: added lit glass to Raven Rock windows at night, added support for the mine entrance, improved window UVs, combined more shapes to improve performance, improved collision, improved shading on chimneys (can't see roof through them now), removed some unused windows, fixed and combined material properties
V2.9.1 - Matched the UV of the interior Raven Rock windows to the exterior. Adds new texture to the Raven Rock windows to match the new UV.